<?php
Yii::import('zii.widgets.CPortlet');
class CategoryList extends CPortlet
{
	public $title = 'Category';
	
	public function renderContent()
	{
		$models = Category::model()->findAll(array(
		    'select' => 'id,name'
		));
		$lis = '';
		foreach ($models as $model) {
			$lis .= CHtml::tag('li', array(), CHtml::link($model->name, array('post/index', 'cid' => $model->id)));
		}
		echo CHtml::tag('ul', array(), $lis);
	}
}